<template>
	<div class="douyin">
		<promptBox v-show='!isRead' @setIsRead="setIsRead"></promptBox>
		<backBtn></backBtn>
		<videoSwiper :list="nurelijanList"></videoSwiper>
	</div>
</template>

<script>
	import {
		getNurelijanListData
	} from '@/api/douyin.js'
	import promptBox from '@/components/douyin/promptBox.vue'
	import videoSwiper from '@/components/douyin/videoSwiper.vue'
	import backBtn from '@/components/douyin/backBtn.vue'
	export default {
		components: {
			promptBox,
			videoSwiper,
			backBtn,
		},
		data() {
			return {
				isRead: false,
				nurelijanList: [],
			}
		},
		async mounted() {
			this.$emit('setLoading', true)
			await this.getNurelijanList()
			this.$emit('setLoading', false)
		},
		methods: {
			async getNurelijanList() {
				const res = await getNurelijanListData()
				if (res) {
					// console.log(res);
					this.nurelijanList = res.data.data
				} else {
					uni.showToast({
						title: '请求失败',
						icon: 'error'
					})
				}
			},
			setIsRead(isRead) {
				this.isRead = isRead
			}
		},
	}
</script>

<style lang="scss" scoped>
	.douyin {}
</style>